package cn.teduymdj.jxc.service.impl;

import cn.teduymdj.jxc.mapper.SupplierMapper;
import cn.teduymdj.jxc.pojo.dto.SupplierAddNewDTO;
import cn.teduymdj.jxc.pojo.entity.Supplier;
import cn.teduymdj.jxc.pojo.vo.SupplierListItemVO;
import cn.teduymdj.jxc.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl implements SupplierService {
    @Autowired
    SupplierMapper supplierMapper;

    @Override
    public Supplier getSupplierById(Long supplierId) {
        return null;
    }

    @Override
    public List<SupplierListItemVO> getSupplierList(Integer page, Integer pageSize, String supplierName) {
        List<SupplierListItemVO> list = supplierMapper.list();
        return list;
    }

    @Override
    public Long getSupplierCount(String supplierName) {
        return null;
    }

    @Override
    public void saveSupplier(Supplier supplier) {
        supplierMapper.insert(supplier);
    }

    @Override
    public void deleteSupplier(Long id) {
        supplierMapper.deleteById(id);
    }

    @Override
    public List<SupplierListItemVO> getComboboxList() {
        List<SupplierListItemVO> list = supplierMapper.list();
        return list;
    }

    @Override
    public void updateSupplier(Supplier supplier) {
        supplierMapper.update(supplier);
    }
}
